<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>test1</title>
    <style>
        .div{
    background-color: red;
    color:white;
    font-size:30px;
    font-weight:bolder;
    margin:20px;
    text-align:center;
}
    </style>
</head>
<body>
<h1 id="h1t">这是一个html测试文档</h1>
<hr>
<div id="div" class="div" onclick="ck()">
    div文本
</div>
<script>
<!--    js定义函数 ArkTS去调用-->
    function chcolor() {
        document.getElementById('h1t').style.color='red'
        return 'ok'
    }

<!--    js定义函数 函数体由ArkTS传入-->
    function ck(){
<!--    ArkTS传入chtxt内容-->
     document.getElementById('div').style.color='blue'
    chtxt()
    }

</script>
</body>
</html>